<template>
  <div class="rootData">
   <div class="system">
	<div class="sm_left">
		<div class="logo"><b></b></div>
		<ul class="nav">
			<li>
				<!-- <a href="javascript:;" class="current"><b class="icon1"></b>运营数据</a> -->
				<router-link :to="{path:'/operationData',query:{type:1}}" :class="{current:type==1}"><b class="icon1"></b>运营数据</router-link>
			</li>
			<li>
				<!-- <a href="javascript:;"><b class="icon2"></b>账户信息</a> -->
				<router-link :to="{path:'/accountMessage',query:{type:2,account:1}}" :class="{current:type==2}"><b class="icon2"></b>账户信息</router-link>
			</li>
		</ul>
	</div>
	<div class="sm_right">
		<div class="inright">
			<div class="head">
				<h4>{{messageTitle}}</h4>
				<div class="info">
					<dl>
						<dt></dt>
 						<dd>Hello，{{companyName}}</dd>
					</dl>
					<a href="javascript:;" @click="loginout()"></a> </div>
			</div>
			 <router-view/>
		</div>
	</div>
</div>
  </div>
</template>

<script >
import commonJs from "@/common/js/common";
export default {
  name: "rootData",
  data() {
    return {
      type: 1,
      messageTitle: "运营数据",
      companyName: "",
      devId: "",
      token: ""
    };
  },
  mounted() {
    this.devId = localStorage.getItem("devId");
    this.token = localStorage.getItem("token");
    this.companyName = localStorage.getItem("companyName");
    this.type = this.$route.query.type;
    if (this.type == 2) {
      this.messageTitle = "账户信息";
    } else {
      this.messageTitle = "运营数据";
    }
  },
  methods: {
    loginout() {
      this.$http({
        method: "POST",
        url: commonJs.BASE_URL + "/loginout.do",
        data: `devId=${this.devId}&token=${this.token}`
      }).then(res => {
        this.$confirm("确定退出登录吗", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        })
          .then(() => {
            this.$router.push({ path: "/" });
            this.$message({
              type: "success",
              message: "退出成功"
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
          });
      });
    }
  },
  components: {},
  watch: {
    $route(to, from) {
      this.type = this.$route.query.type;
      if (this.type == 2) {
        this.messageTitle = "账户信息";
      } else {
        this.messageTitle = "运营数据";
      }
    }
  }
};
</script>
<style scoped>
.rootData {
  width: 100%;
  height: 100%;
}
.clearfix:after {
  content: ".";
  display: block;
  clear: both;
  visibility: hidden;
  line-height: 0;
  height: 0;
  font-size: 0;
}
.clearfix {
  display: inline-block;
  zoom: 1;
}
html[xmlns] .clearfix {
  display: block;
}
* html .clearfix {
  zoom: 1;
}
a:link,
a:visited,
a:hover {
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}
a:focus {
  outline: none;
}
html {
  height: 100%;
}
body {
  font: 13px/1.6 "Microsoft YaHei", "微软雅黑", Trebuchet MS, tahoma, sans-serif;
  background: #fff;
  color: #333;
  height: 100%;
}
a:link.btn_ashy,
a:visited.btn_ashy {
  display: inline-block;
  padding: 0px 10px;
  width: 30px;
  height: 28px;
  line-height: 28px;
  color: #666;
  text-align: center;
  border: 1px solid #ebebeb;
}
a:hover.btn_ashy {
  border: 1px solid #dbdbdb;
}
a:link.btn_org,
a:visited.btn_org {
  display: inline-block;
  padding: 0px 10px;
  height: 28px;
  line-height: 28px;
  color: #fff;
  text-align: center;
  border: 1px solid #fa8b00;
  background: #fa8b00;
}
a:hover.btn_org {
  border: 1px solid #ed8301;
  background: #ed8301;
}
.system {
  min-width: 1200px;
  height: 100%;
  overflow: hidden;
}
.sm_left {
  position: relative;
  float: left;
  width: 170px;
  margin-right: -170px;
  height: 100%;
  background: #303030;
}
.sm_left .logo {
  height: 88px;
  overflow: hidden;
  background: #25292a;
}
.sm_left .logo b {
  width: 118px;
  height: 40px;
  background: url(/static/common/images/spp.png) no-repeat;
  background-position: left -126px;
  display: block;
  margin: 25px auto;
  margin-bottom: 0px;
}
.sm_left .nav {
  padding-top: 30px;
}
.sm_left .nav li {
  height: 50px;
  margin-bottom: 14px;
}
.sm_left .nav li a {
  position: relative;
}
.sm_left .nav li a:link,
.sm_left .nav li a:visited {
  display: block;
  font-size: 15px;
  text-indent: 60px;
  width: 166px;
  height: 50px;
  line-height: 50px;
  color: #fff;
  border-left: 4px solid #fff;
  background: #414141;
}
.sm_left .nav li a:hover,
.sm_left .nav li a.current {
  border-left: 4px solid #fa8b00;
  color: #fa8b00;
  background: #25292a;
}
.sm_left .nav li a b {
  display: block;
  width: 32px;
  height: 23px;
  background: url(/static/common/images/spp.png) no-repeat;
  position: absolute;
  top: 50%;
  left: 16px;
  margin-top: -11px;
}
.sm_left .nav li a .icon1 {
  background-position: -42px top;
}
.sm_left .nav li a .icon2 {
  background-position: -42px -33px;
}
.sm_left .nav li a.current .icon1,
.sm_left .nav li a:hover .icon1 {
  background-position: left top;
}
.sm_left .nav li a.current .icon2,
.sm_left .nav li a:hover .icon2 {
  background-position: left -33px;
}
.sm_right {
  float: right;
  width: 100%;
  height: 100%;
  background: #eee;
}
.sm_right .inright {
  margin-left: 170px;
  height: 100%;
}
.head {
  width: 100%;
  height: 55px;
  line-height: 55px;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.head h4 {
  font-size: 20px;
  color: #666;
  padding-left: 20px;
}
.head .info {
  position: absolute;
  top: 0;
  right: 24px;
}
.head .info dl {
  position: relative;
  height: 55px;
  font-size: 15px;
  float: left;
}
.head .info dl dt {
  width: 32px;
  height: 32px;
  background: url(/static/common/images/spp.png) left -176px;
  position: absolute;
  top: 50%;
  left: 0;
  margin-top: -16px;
}
.head .info dl dd {
  padding-left: 38px;
  color: #888;
}
.head .info a {
  display: block;
  width: 32px;
  height: 32px;
  background: url(/static/common/images/spp.png);
  background-position: left -218px;
  float: left;
  margin-top: 12px;
  margin-left: 20px;
}
.head .info a:hover {
  background-position: -42px -218px;
}
.main {
  margin: 12px;
  margin-right: 0;
  background: #fff;
  height: 100%;
  overflow: auto;
}
.main .menu {
  width: 100%;
  background: #eeeeee;
  height: 45px;
}
.main .menu li {
  float: left;
  margin-right: 6px;
  position: relative;
}
.menu li b {
  width: 22px;
  height: 22px;
  display: block;
  background: url(/static/common/images/spp.png) no-repeat;
  position: absolute;
  top: 50%;
  margin-top: -11px;
  left: 22px;
}
.menu li b.ia_1 {
  background-position: left -94px;
}
.menu li b.ia_2 {
  background-position: -32px -94px;
}
.menu li b.ia_3 {
  background-position: -64px -94px;
}
.menu li b.ia_4 {
  background-position: -96px -94px;
}
.menu li a:link,
.menu li a:visited {
  font-size: 14px;
  color: #666;
  background: #e0e0e0;
  width: 130px;
  display: block;
  text-indent: 48px;
  height: 43px;
  line-height: 43px;
  border-top: 2px solid #e0e0e0;
}
.menu li a:hover,
.menu li a.current {
  color: #fa8b00;
  background: #fff;
  border-top: 2px solid #fa8b00;
}
.menu li a.current b.ia_1,
.menu li a:hover b.ia_1 {
  background-position: left -62px;
}
.menu li a.current b.ia_2,
.menu li a:hover b.ia_2 {
  background-position: -32px -62px;
}
.menu li a.current b.ia_3,
.menu li a:hover b.ia_3 {
  background-position: -64px -62px;
}
.menu li a.current b.ia_4,
.menu li a:hover b.ia_4 {
  background-position: -96px -62px;
}
.main .content {
  width: 80%;
  margin: 20px auto;
}
.area {
  border: 1px solid #ebebeb;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
}
.list {
  width: 100%;
  min-height: 400px;
  position: relative;
}
.list b.cry {
  width: 190px;
  height: 190px;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -95px;
  margin-left: -95px;
  background: url(/static/common/images/cry.png) no-repeat;
}
.list h5 {
  font-size: 18px;
}
.list table {
  width: 100%;
  margin-top: 20px;
}
.list table th {
  font-size: 14px;
  font-weight: bold;
  color: #000;
  height: 36px;
}
.list table td {
  color: #999;
  text-align: center;
  border-bottom: 1px solid #eee;
  padding: 6px 0px;
}
.paginal {
  clear: both;
  padding: 8px;
  cursor: default;
  font-size: 12px;
  text-align: center;
  margin-top: 30px;
}
.paginal a {
  margin: 0 2px;
  color: #666;
  padding: 1px 4px;
  border: 1px solid #e0e0e0;
  text-decoration: none;
  -webkit-transition: background-color 0.2s ease 0s, border-color 0.6s ease 0s;
  -ms-transition: background-color 0.2s ease 0s, border-color 0.6s ease 0s;
  -o-transition: background-color 0.2s ease 0s, border-color 0.6s ease 0s;
  transition: background-color 0.2s ease 0s, border-color 0.6s ease 0s;
}
.paginal a:hover {
  background-color: #fa8b00;
  color: #fff;
  border: 1px solid #fa8b00;
  text-decoration: none;
}
.paginal span {
  color: #fa8b00;
  display: inline-block;
  padding-top: 5px;
}
</style>
